You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TRandomGenerator Class > TRandomGenerator Methods > TRandomGenerator.LoadFromFile Method
Dew Math for .NET
ContentsIndexHome
Example
var rnd: TRandomGenerator; iVec: VectorInt; begin rnd := TRandomGenerator.Create; rnd.StreamIndependence := TRngStreamIndependence.rsiLeapfrog; try iVec.Size(1000); rnd.StreamCount := 2; rnd.Stream[0].RandomUniformbitsI(iVec); rnd.Stream[1].RandomUniformbitsI(iVec); rnd.SaveToFile('D:Test.rnd'); finally rnd.Free; end; rnd := TRandomGenerator.Create; //load stream count, and individual stream state at the time when they were saved rnd.LoadFromFile('D:Test.rnd'); try //continue where we left of:... rnd.Stream[0].RandomUniformbitsI(iVec); rnd.Stream[1].RandomUniformbitsI(iVec); finally rnd.Free; end; end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.